<div id="finance-statistic-view">
  <div class="page">
    <div class="al-list-container">
      <form class="form-horizontal al-search-container" role="form">
        <div class="form-group">
          <label class="col-sm-1 control-label">公寓</label>
          <div class="col-sm-2" ng-if="apartmentList.length>1">
            <qgy-apartment-item apm-data="search" apm-list="apartmentList"></qgy-apartment-item>
          </div>
          <label class="col-sm-1 control-label">时间段</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.payTimeStart" is-open="enterStart" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterStart=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
          <label class="control-label text-center al-fl-lt">&nbsp;&nbsp;~&nbsp;&nbsp;</label>
          <div class="col-sm-2">
            <div class="input-group">
              <input class="form-control" type="text" uib-datepicker-popup="yyyy-MM-dd"
                     ng-model="search.payTimeEnd" is-open="enterEnd" maxlength="10"
                     close-text="关闭" current-text="今天" clear-text="清空"
                     placeholder=""/>
              <span class="input-group-btn">
                <button type="button" class="btn btn-default" ng-click="enterEnd=true">
                  <i class="glyphicon glyphicon-calendar"></i>
                </button>
              </span>
            </div>
          </div>
          <div class="col-sm-1">
            <button type="button" ng-click="queryData()" class="btn btn-success al-float-right">查询</button>
          </div>
          <div class="col-sm-1">
            <button type="button" ng-click="resetSearch()" class="btn btn-default">重置</button>
          </div>
          <div class="col-sm-1 col-sm-offset-1" style="float: right">
              <button class="btn btn-primary"
                      style="float:right"
                      ng-if="!exporting"
                      data-ng-disabled="exporting"
                      ng-confirm-click="确定要导出吗？"
                      ng-click="exportData()">
                导出Excel
              </button>
              <button class="btn btn-primary"
                      style="float:right"
                      ng-if="exporting"
                      disabled>
                正在导出。。
              </button>
          </div>
        </div>
      </form>
      <table ng-table="tableParams"
             class="table  table-bordered table-striped table-condensed al-table-container">
        <caption class="">

        </caption>
        <thead>
        <tr style="vertical-align: center;text-align: center">
          <td rowspan="2">序号</td>
          <td rowspan="2">日期</td>
          <!--<td>公寓</td>-->
          <td rowspan="2">房间号</td>
          <td rowspan="2">客户姓名</td>
          <td rowspan="2">入住日期</td>
          <td rowspan="2">合同日期</td>
          <td rowspan="2">付款方式</td>
          <td colspan="6">费用明细</td>
          <td colspan="3">付款渠道</td>
          <td rowspan="2">总额</td>
        </tr>
        <tr style="vertical-align: center;text-align: center">
          <td>定金</td>
          <td>租金</td>
          <td>押金</td>
          <td>电费</td>
          <td>水费</td>
          <td>物业费</td>
          <td>微信</td>
          <td>支付宝</td>
          <td>POS机</td>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="sumInfo">
          <td>总计</td>
          <td class="text-center">--</td>
          <td class="text-center">--</td>
          <td class="text-center">--</td>
          <td class="text-center">--</td>
          <td class="text-center">--</td>
          <td class="text-center">--</td>
          <td>{{sumInfo.earnest}}</td>
          <td>{{sumInfo.rental}}</td>
          <td>{{sumInfo.deposit}}</td>
          <td>{{sumInfo.electricCharge}}</td>
          <td>{{sumInfo.waterRate}}</td>
          <td>{{sumInfo.propertyFee}}</td>
          <td>{{sumInfo.weChat}}</td>
          <td>{{sumInfo.aliPay}}</td>
          <td>{{sumInfo.posMachine}}</td>
          <td>{{sumInfo.totalMoney}}</td>
        </tr>
        <tr ng-repeat="item in $data">
          <td>{{$index+1}}</td>
          <td>{{item.reportDate|dateTransfer:'YYYY-MM-DD'}}</td>
          <td>{{item.apartmentName+' '+item.houseNo}}</td>
          <td>{{item.customerName}}</td>
          <td>{{item.occupancyTime|dateTransfer:'YYYY-MM-DD'}}</td>
          <td>{{item.leaseStart|dateTransfer:'YYYY-MM-DD'}}&nbsp;&nbsp;~&nbsp;&nbsp;{{item.getLeaseEnd|dateTransfer:'YYYY-MM-DD'}}</td>
          <td>{{item.payType|constantTransfer:contractPayWayList}}</td>
          <td>{{item.earnest}}</td>
          <td>{{item.rental}}</td>
          <td>{{item.deposit}}</td>
          <td>{{item.electricCharge}}</td>
          <td>{{item.waterRate}}</td>
          <td>{{item.propertyFee}}</td>
          <td>{{item.weChat}}</td>
          <td>{{item.aliPay}}</td>
          <td>{{item.posMachine}}</td>
          <td>{{item.totalMoney}}</td>
        </tr>

        </tbody>
      </table>
    </div>
  </div>
</div>
